// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by sidekick. DO NOT EDIT.

#![allow(rustdoc::redundant_explicit_links)]
#![allow(rustdoc::broken_intra_doc_links)]
#![no_implicit_prelude]
extern crate async_trait;
extern crate bytes;
extern crate gax;
extern crate gaxi;
extern crate gtype;
extern crate lazy_static;
extern crate location;
extern crate longrunning;
extern crate lro;
extern crate reqwest;
extern crate serde;
extern crate serde_json;
extern crate serde_with;
extern crate std;
extern crate tracing;
extern crate wkt;

mod debug;
mod deserialize;
mod serialize;

/// BacktestResult is created to test the performance of a model on a dataset.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BacktestResult {
    /// Output only. The resource name of the BacktestResult.
    /// format:
    /// `/projects/{project_num}/locations/{location}/instances/{instance}/backtestResults/{backtest_result}`
    pub name: std::string::String,

    /// Output only. The timestamp of creation of this resource.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The timestamp of the most recent update of this resource.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// Labels
    pub labels: std::collections::HashMap<std::string::String, std::string::String>,

    /// Output only. State of the BacktestResult (creating, active, deleting, etc.)
    pub state: crate::model::backtest_result::State,

    /// Required. The resource name of the Dataset to backtest on
    /// Format:
    /// `/projects/{project_num}/locations/{location}/instances/{instance}/datasets/{dataset}`
    pub dataset: std::string::String,

    /// Required. The resource name of the Model to use or to backtest.
    /// Format:
    /// `/projects/{project_num}/locations/{location}/instances/{instance}/models/{model}`
    pub model: std::string::String,

    /// Required. End_time specifies the latest time from which labels are used and
    /// from which data is used to generate features for backtesting.  End_time
    /// should be no later than the end of the date_range of the primary dataset.
    pub end_time: std::option::Option<wkt::Timestamp>,

    /// The number of consecutive months to conduct backtesting for, ending with
    /// the last full month prior to the end_time according to the dataset's
    /// timezone.
    pub backtest_periods: i32,

    /// Required. PerformanceTarget gives information on how the test will be
    /// evaluated.
    pub performance_target: std::option::Option<crate::model::backtest_result::PerformanceTarget>,

    /// Output only. The line of business (Retail/Commercial) this backtest is for.
    /// Determined by Model, cannot be set by user.
    pub line_of_business: crate::model::LineOfBusiness,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl BacktestResult {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::BacktestResult::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::BacktestResult::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::BacktestResult::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::BacktestResult::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::BacktestResult::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [labels][crate::model::BacktestResult::labels].
    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [state][crate::model::BacktestResult::state].
    pub fn set_state<T: std::convert::Into<crate::model::backtest_result::State>>(
        mut self,
        v: T,
    ) -> Self {
        self.state = v.into();
        self
    }

    /// Sets the value of [dataset][crate::model::BacktestResult::dataset].
    pub fn set_dataset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.dataset = v.into();
        self
    }

    /// Sets the value of [model][crate::model::BacktestResult::model].
    pub fn set_model<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.model = v.into();
        self
    }

    /// Sets the value of [end_time][crate::model::BacktestResult::end_time].
    pub fn set_end_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.end_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [end_time][crate::model::BacktestResult::end_time].
    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.end_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [backtest_periods][crate::model::BacktestResult::backtest_periods].
    pub fn set_backtest_periods<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.backtest_periods = v.into();
        self
    }

    /// Sets the value of [performance_target][crate::model::BacktestResult::performance_target].
    pub fn set_performance_target<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::backtest_result::PerformanceTarget>,
    {
        self.performance_target = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [performance_target][crate::model::BacktestResult::performance_target].
    pub fn set_or_clear_performance_target<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::backtest_result::PerformanceTarget>,
    {
        self.performance_target = v.map(|x| x.into());
        self
    }

    /// Sets the value of [line_of_business][crate::model::BacktestResult::line_of_business].
    pub fn set_line_of_business<T: std::convert::Into<crate::model::LineOfBusiness>>(
        mut self,
        v: T,
    ) -> Self {
        self.line_of_business = v.into();
        self
    }
}

impl wkt::message::Message for BacktestResult {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.financialservices.v1.BacktestResult"
    }
}

/// Defines additional types related to [BacktestResult].
pub mod backtest_result {
    #[allow(unused_imports)]
    use super::*;

    /// PerformanceTarget gives hints on how to evaluate the performance of a
    /// model.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct PerformanceTarget {
        /// Required. A number that gives the tuner a hint on the number of parties
        /// from this data that will be investigated per period (monthly). This is
        /// used to control how the model is evaluated. For example, when trying AML
        /// AI for the first time, we recommend setting this to the number of parties
        /// investigated in an average month, based on alerts from your existing
        /// automated alerting system.
        pub party_investigations_per_period_hint: i64,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl PerformanceTarget {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [party_investigations_per_period_hint][crate::model::backtest_result::PerformanceTarget::party_investigations_per_period_hint].
        pub fn set_party_investigations_per_period_hint<T: std::convert::Into<i64>>(
            mut self,
            v: T,
        ) -> Self {
            self.party_investigations_per_period_hint = v.into();
            self
        }
    }

    impl wkt::message::Message for PerformanceTarget {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.financialservices.v1.BacktestResult.PerformanceTarget"
        }
    }

    /// The possible states of a resource.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum State {
        /// State is unspecified, should not occur.
        Unspecified,
        /// The resource has not finished being created.
        Creating,
        /// The resource is active/ready to be used.
        Active,
        /// The resource is in the process of being updated.
        Updating,
        /// The resource is in the process of being deleted.
        Deleting,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [State::value] or
        /// [State::name].
        UnknownValue(state::UnknownValue),
    }

    #[doc(hidden)]
    pub mod state {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl State {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Creating => std::option::Option::Some(1),
                Self::Active => std::option::Option::Some(2),
                Self::Updating => std::option::Option::Some(3),
                Self::Deleting => std::option::Option::Some(4),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
                Self::Creating => std::option::Option::Some("CREATING"),
                Self::Active => std::option::Option::Some("ACTIVE"),
                Self::Updating => std::option::Option::Some("UPDATING"),
                Self::Deleting => std::option::Option::Some("DELETING"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for State {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for State {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for State {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Creating,
                2 => Self::Active,
                3 => Self::Updating,
                4 => Self::Deleting,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for State {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "STATE_UNSPECIFIED" => Self::Unspecified,
                "CREATING" => Self::Creating,
                "ACTIVE" => Self::Active,
                "UPDATING" => Self::Updating,
                "DELETING" => Self::Deleting,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for State {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Creating => serializer.serialize_i32(1),
                Self::Active => serializer.serialize_i32(2),
                Self::Updating => serializer.serialize_i32(3),
                Self::Deleting => serializer.serialize_i32(4),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for State {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
                ".google.cloud.financialservices.v1.BacktestResult.State",
            ))
        }
    }
}

/// Request for retrieving a paginated list of BacktestResult resources that
/// meet the specified criteria.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListBacktestResultsRequest {
    /// Required. The parent of the BacktestResult is the Instance.
    pub parent: std::string::String,

    /// The number of resources to be included in the response. The response
    /// contains a next_page_token, which can be used to retrieve the next page of
    /// resources.
    pub page_size: i32,

    /// In case of paginated results, this is the token that was returned in the
    /// previous ListBacktestResultsResponse. It should be copied here to
    /// retrieve the next page of resources. Empty will give the first page of
    /// ListBacktestResultsRequest, and the last page will return an empty
    /// page_token.
    pub page_token: std::string::String,

    /// Specify a filter to narrow search results.
    pub filter: std::string::String,

    /// Specify a field to use for ordering.
    pub order_by: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListBacktestResultsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListBacktestResultsRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListBacktestResultsRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListBacktestResultsRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListBacktestResultsRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [order_by][crate::model::ListBacktestResultsRequest::order_by].
    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.order_by = v.into();
        self
    }
}

impl wkt::message::Message for ListBacktestResultsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.financialservices.v1.ListBacktestResultsRequest"
    }
}

/// Response for retrieving a list of BacktestResults
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListBacktestResultsResponse {
    /// List of BacktestResult resources
    pub backtest_results: std::vec::Vec<crate::model::BacktestResult>,

    /// This token should be passed to the next ListBacktestResultsRequest to
    /// retrieve the next page of BacktestResults (empty indicates we are
    /// done).
    pub next_page_token: std::string::String,

    /// Locations that could not be reached.
    pub unreachable: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListBacktestResultsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [backtest_results][crate::model::ListBacktestResultsResponse::backtest_results].
    pub fn set_backtest_results<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::BacktestResult>,
    {
        use std::iter::Iterator;
        self.backtest_results = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListBacktestResultsResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }

    /// Sets the value of [unreachable][crate::model::ListBacktestResultsResponse::unreachable].
    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.unreachable = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ListBacktestResultsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.financialservices.v1.ListBacktestResultsResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListBacktestResultsResponse {
    type PageItem = crate::model::BacktestResult;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.backtest_results
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Request for retrieving a specific BacktestResult resource.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetBacktestResultRequest {
    /// Required. The resource name of the BacktestResult
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetBacktestResultRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetBacktestResultRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetBacktestResultRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.financialservices.v1.GetBacktestResultRequest"
    }
}

/// Request for creating a BacktestResult resource.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateBacktestResultRequest {
    /// Required. The parent of the BacktestResult is the Instance.
    pub parent: std::string::String,

    /// Required. The resource id of the BacktestResult
    pub backtest_result_id: std::string::String,

    /// Required. The BacktestResult that will be created.
    pub backtest_result: std::option::Option<crate::model::BacktestResult>,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and the
    /// request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateBacktestResultRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateBacktestResultRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [backtest_result_id][crate::model::CreateBacktestResultRequest::backtest_result_id].
    pub fn set_backtest_result_id<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.backtest_result_id = v.into();
        self
    }

    /// Sets the value of [backtest_result][crate::model::CreateBacktestResultRequest::backtest_result].
    pub fn set_backtest_result<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::BacktestResult>,
    {
        self.backtest_result = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [backtest_result][crate::model::CreateBacktestResultRequest::backtest_result].
    pub fn set_or_clear_backtest_result<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::BacktestResult>,
    {
        self.backtest_result = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::CreateBacktestResultRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for CreateBacktestResultRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.financialservices.v1.CreateBacktestResultRequest"
    }
}

/// Request for updating a BacktestResult
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateBacktestResultRequest {
    /// Optional. Field mask is used to specify the fields to be overwritten in the
    /// BacktestResult resource by the update.
    /// The fields specified in the update_mask are relative to the resource, not
    /// the full request. A field will be overwritten if it is in the mask. If the
    /// user does not provide a mask then all fields will be overwritten.
    pub update_mask: std::option::Option<wkt::FieldMask>,

    /// Required. The new value of the BacktestResult fields that will be updated
    /// according to the update_mask.
    pub backtest_result: std::option::Option<crate::model::BacktestResult>,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and the
    /// request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdateBacktestResultRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [update_mask][crate::model::UpdateBacktestResultRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdateBacktestResultRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }

    /// Sets the value of [backtest_result][crate::model::UpdateBacktestResultRequest::backtest_result].
    pub fn set_backtest_result<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::BacktestResult>,
    {
        self.backtest_result = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [backtest_result][crate::model::UpdateBacktestResultRequest::backtest_result].
    pub fn set_or_clear_backtest_result<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::BacktestResult>,
    {
        self.backtest_result = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::UpdateBacktestResultRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for UpdateBacktestResultRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.financialservices.v1.UpdateBacktestResultRequest"
    }
}

/// Request for deleting a BacktestResult.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteBacktestResultRequest {
    /// Required. The resource name of the BacktestResult.
    pub name: std::string::String,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes after the first request.
    ///
    /// For example, consider a situation where you make an initial request and the
    /// request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteBacktestResultRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteBacktestResultRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::DeleteBacktestResultRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for DeleteBacktestResultRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.financialservices.v1.DeleteBacktestResultRequest"
    }
}

/// Request for exporting BacktestResult metadata.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExportBacktestResultMetadataRequest {
    /// Required. The resource name of the BacktestResult.
    pub backtest_result: std::string::String,

    /// Required. BigQuery output where the metadata will be written.
    pub structured_metadata_destination: std::option::Option<crate::model::BigQueryDestination>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ExportBacktestResultMetadataRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [backtest_result][crate::model::ExportBacktestResultMetadataRequest::backtest_result].
    pub fn set_backtest_result<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.backtest_result = v.into();
        self
    }

    /// Sets the value of [structured_metadata_destination][crate::model::ExportBacktestResultMetadataRequest::structured_metadata_destination].
    pub fn set_structured_metadata_destination<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::BigQueryDestination>,
    {
        self.structured_metadata_destination = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [structured_metadata_destination][crate::model::ExportBacktestResultMetadataRequest::structured_metadata_destination].
    pub fn set_or_clear_structured_metadata_destination<T>(
        mut self,
        v: std::option::Option<T>,
    ) -> Self
    where
        T: std::convert::Into<crate::model::BigQueryDestination>,
    {
        self.structured_metadata_destination = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for ExportBacktestResultMetadataRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.financialservices.v1.ExportBacktestResultMetadataRequest"
    }
}

/// Response for exporting BacktestResult metadata.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExportBacktestResultMetadataResponse {
    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ExportBacktestResultMetadataResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }
}

impl wkt::message::Message for ExportBacktestResultMetadataResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.financialservices.v1.ExportBacktestResultMetadataResponse"
    }
}

/// BigQueryDestination is a wrapper for BigQuery output information.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BigQueryDestination {
    /// Optional. BigQuery URI to a table, must be of the form
    /// bq://projectId.bqDatasetId.tableId.
    /// Note that the BigQuery dataset must already exist.
    /// VPC-SC restrictions apply.
    pub table_uri: std::string::String,

    /// Required. Whether or not to overwrite the destination table. By default the
    /// table won't be overwritten and an error will be returned if the table
    /// exists and contains data.
    pub write_disposition: crate::model::big_query_destination::WriteDisposition,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl BigQueryDestination {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [table_uri][crate::model::BigQueryDestination::table_uri].
    pub fn set_table_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.table_uri = v.into();
        self
    }

    /// Sets the value of [write_disposition][crate::model::BigQueryDestination::write_disposition].
    pub fn set_write_disposition<
        T: std::convert::Into<crate::model::big_query_destination::WriteDisposition>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.write_disposition = v.into();
        self
    }
}

impl wkt::message::Message for BigQueryDestination {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.financialservices.v1.BigQueryDestination"
    }
}

/// Defines additional types related to [BigQueryDestination].
pub mod big_query_destination {
    #[allow(unused_imports)]
    use super::*;

    /// WriteDisposition controls the behavior when the destination table already
    /// exists.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum WriteDisposition {
        /// Default behavior is the same as WRITE_EMPTY.
        Unspecified,
        /// If the table already exists and contains data, an error is returned.
        WriteEmpty,
        /// If the table already exists, the data will be overwritten.
        WriteTruncate,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [WriteDisposition::value] or
        /// [WriteDisposition::name].
        UnknownValue(write_disposition::UnknownValue),
    }

    #[doc(hidden)]
    pub mod write_disposition {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl WriteDisposition {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::WriteEmpty => std::option::Option::Some(1),
                Self::WriteTruncate => std::option::Option::Some(2),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("WRITE_DISPOSITION_UNSPECIFIED"),
                Self::WriteEmpty => std::option::Option::Some("WRITE_EMPTY"),
                Self::WriteTruncate => std::option::Option::Some("WRITE_TRUNCATE"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for WriteDisposition {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for WriteDisposition {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for WriteDisposition {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::WriteEmpty,
                2 => Self::WriteTruncate,
                _ => Self::UnknownValue(write_disposition::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for WriteDisposition {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "WRITE_DISPOSITION_UNSPECIFIED" => Self::Unspecified,
                "WRITE_EMPTY" => Self::WriteEmpty,
                "WRITE_TRUNCATE" => Self::WriteTruncate,
                _ => Self::UnknownValue(write_disposition::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for WriteDisposition {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::WriteEmpty => serializer.serialize_i32(1),
                Self::WriteTruncate => serializer.serialize_i32(2),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for WriteDisposition {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<WriteDisposition>::new(
                ".google.cloud.financialservices.v1.BigQueryDestination.WriteDisposition",
            ))
        }
    }
}

/// The Dataset resource contains summary information about a dataset.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Dataset {
    /// Output only. The resource name of the Dataset.
    /// format:
    /// `/projects/{project_num}/locations/{location}/instances/{instance}/datasets/{dataset}`
    pub name: std::string::String,

    /// Output only. The timestamp of creation of this resource.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The timestamp of the most recent update of this resource.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// Labels
    pub labels: std::collections::HashMap<std::string::String, std::string::String>,

    /// Required. The set of BigQuery tables in the dataset.  The key should be the
    /// table type and the value should be the BigQuery tables in the format
    /// `bq://{project}.{dataset}.{table}`.
    /// Current table types are:
    ///
    /// * `party`
    /// * `account_party_link`
    /// * `transaction`
    /// * `risk_case_event`
    /// * `party_supplementary_data`
    pub table_specs: std::collections::HashMap<std::string::String, std::string::String>,

    /// Output only. State of the dataset (creating, active, deleting, etc.)
    pub state: crate::model::dataset::State,

    /// Required. Core time window of the dataset. All tables should have complete
    /// data covering this period.
    pub date_range: std::option::Option<gtype::model::Interval>,

    /// The timezone of the data, default will act as UTC.
    pub time_zone: std::option::Option<gtype::model::TimeZone>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Dataset {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::Dataset::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::Dataset::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::Dataset::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::Dataset::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::Dataset::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [labels][crate::model::Dataset::labels].
    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [table_specs][crate::model::Dataset::table_specs].
    pub fn set_table_specs<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.table_specs = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [state][crate::model::Dataset::state].
    pub fn set_state<T: std::convert::Into<crate::model::dataset::State>>(mut self, v: T) -> Self {
        self.state = v.into();
        self
    }

    /// Sets the value of [date_range][crate::model::Dataset::date_range].
    pub fn set_date_range<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<gtype::model::Interval>,
    {
        self.date_range = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [date_range][crate::model::Dataset::date_range].
    pub fn set_or_clear_date_range<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<gtype::model::Interval>,
    {
        self.date_range = v.map(|x| x.into());
        self
    }

    /// Sets the value of [time_zone][crate::model::Dataset::time_zone].
    pub fn set_time_zone<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<gtype::model::TimeZone>,
    {
        self.time_zone = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [time_zone][crate::model::Dataset::time_zone].
    pub fn set_or_clear_time_zone<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<gtype::model::TimeZone>,
    {
        self.time_zone = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for Dataset {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.financialservices.v1.Dataset"
    }
}

/// Defines additional types related to [Dataset].
pub mod dataset {
    #[allow(unused_imports)]
    use super::*;

    /// The possible states of a resource.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum State {
        /// State is unspecified, should not occur.
        Unspecified,
        /// The resource has not finished being created.
        Creating,
        /// The resource is active/ready to be used.
        Active,
        /// The resource is in the process of being updated.
        Updating,
        /// The resource is in the process of being deleted.
        Deleting,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [State::value] or
        /// [State::name].
        UnknownValue(state::UnknownValue),
    }

    #[doc(hidden)]
    pub mod state {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl State {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Creating => std::option::Option::Some(1),
                Self::Active => std::option::Option::Some(2),
                Self::Updating => std::option::Option::Some(3),
                Self::Deleting => std::option::Option::Some(4),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
                Self::Creating => std::option::Option::Some("CREATING"),
                Self::Active => std::option::Option::Some("ACTIVE"),
                Self::Updating => std::option::Option::Some("UPDATING"),
                Self::Deleting => std::option::Option::Some("DELETING"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for State {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for State {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for State {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Creating,
                2 => Self::Active,
                3 => Self::Updating,
                4 => Self::Deleting,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for State {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "STATE_UNSPECIFIED" => Self::Unspecified,
                "CREATING" => Self::Creating,
                "ACTIVE" => Self::Active,
                "UPDATING" => Self::Updating,
                "DELETING" => Self::Deleting,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for State {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Creating => serializer.serialize_i32(1),
                Self::Active => serializer.serialize_i32(2),
                Self::Updating => serializer.serialize_i32(3),
                Self::Deleting => serializer.serialize_i32(4),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for State {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
                ".google.cloud.financialservices.v1.Dataset.State",
            ))
        }
    }
}

/// Request for retrieving a paginated list of Dataset resources that meet the
/// specified criteria.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListDatasetsRequest {
    /// Required. The parent of the Dataset is the Instance.
    pub parent: std::string::String,

    /// The number of resources to be included in the response. The response
    /// contains a next_page_token, which can be used to retrieve the next page of
    /// resources.
    pub page_size: i32,

    /// In case of paginated results, this is the token that was returned in the
    /// previous ListDatasetResponse. It should be copied here to retrieve the
    /// next page of resources. Empty will give the first page of
    /// ListDatasetRequest, and the last page will return an empty page_token.
    pub page_token: std::string::String,

    /// Specify a filter to narrow search results.
    pub filter: std::string::String,

    /// Specify a field to use for ordering.
    pub order_by: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListDatasetsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListDatasetsRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListDatasetsRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListDatasetsRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListDatasetsRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [order_by][crate::model::ListDatasetsRequest::order_by].
    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.order_by = v.into();
        self
    }
}

impl wkt::message::Message for ListDatasetsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.financialservices.v1.ListDatasetsRequest"
    }
}

/// Response for retrieving a list of Datasets
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListDatasetsResponse {
    /// List of Dataset resources
    pub datasets: std::vec::Vec<crate::model::Dataset>,

    /// This token should be passed to the next ListDatasetsRequest to retrieve
    /// the next page of Datasets (empty indicates we are done).
    pub next_page_token: std::string::String,

    /// Locations that could not be reached.
    pub unreachable: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListDatasetsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [datasets][crate::model::ListDatasetsResponse::datasets].
    pub fn set_datasets<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::Dataset>,
    {
        use std::iter::Iterator;
        self.datasets = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListDatasetsResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }

    /// Sets the value of [unreachable][crate::model::ListDatasetsResponse::unreachable].
    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.unreachable = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ListDatasetsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.financialservices.v1.ListDatasetsResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListDatasetsResponse {
    type PageItem = crate::model::Dataset;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.datasets
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Request for retrieving a specific Dataset resource.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetDatasetRequest {
    /// Required. The resource name of the Dataset
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetDatasetRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetDatasetRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetDatasetRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.financialservices.v1.GetDatasetRequest"
    }
}

/// Request for creating a Dataset resource.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateDatasetRequest {
    /// Required. The parent of the Dataset is the Instance.
    pub parent: std::string::String,

    /// Required. The resource id of the dataset
    pub dataset_id: std::string::String,

    /// Required. The dataset that will be created.
    pub dataset: std::option::Option<crate::model::Dataset>,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and the
    /// request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateDatasetRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateDatasetRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [dataset_id][crate::model::CreateDatasetRequest::dataset_id].
    pub fn set_dataset_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.dataset_id = v.into();
        self
    }

    /// Sets the value of [dataset][crate::model::CreateDatasetRequest::dataset].
    pub fn set_dataset<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Dataset>,
    {
        self.dataset = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [dataset][crate::model::CreateDatasetRequest::dataset].
    pub fn set_or_clear_dataset<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Dataset>,
    {
        self.dataset = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::CreateDatasetRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for CreateDatasetRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.financialservices.v1.CreateDatasetRequest"
    }
}

/// Request for updating a Dataset
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateDatasetRequest {
    /// Optional. Field mask is used to specify the fields to be overwritten in the
    /// Dataset resource by the update.
    /// The fields specified in the update_mask are relative to the resource, not
    /// the full request. A field will be overwritten if it is in the mask. If the
    /// user does not provide a mask then all fields will be overwritten.
    pub update_mask: std::option::Option<wkt::FieldMask>,

    /// Required. The new value of the dataset fields that will be updated
    /// according to the update_mask.
    pub dataset: std::option::Option<crate::model::Dataset>,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and the
    /// request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdateDatasetRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [update_mask][crate::model::UpdateDatasetRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdateDatasetRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }

    /// Sets the value of [dataset][crate::model::UpdateDatasetRequest::dataset].
    pub fn set_dataset<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Dataset>,
    {
        self.dataset = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [dataset][crate::model::UpdateDatasetRequest::dataset].
    pub fn set_or_clear_dataset<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Dataset>,
    {
        self.dataset = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::UpdateDatasetRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for UpdateDatasetRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.financialservices.v1.UpdateDatasetRequest"
    }
}

/// Request for deleting a Dataset.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteDatasetRequest {
    /// Required. The resource name of the Dataset.
    pub name: std::string::String,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes after the first request.
    ///
    /// For example, consider a situation where you make an initial request and the
    /// request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteDatasetRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteDatasetRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::DeleteDatasetRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for DeleteDatasetRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.financialservices.v1.DeleteDatasetRequest"
    }
}

/// The EngineConfig resource creates the configuration for training a model.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EngineConfig {
    /// Output only. The resource name of the EngineConfig.
    /// format:
    /// `/projects/{project_num}/locations/{location}/instances/{instance}/engineConfigs/{engine_config}`
    pub name: std::string::String,

    /// Output only. The timestamp of creation of this resource.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The timestamp of the most recent update of this resource.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// Labels
    pub labels: std::collections::HashMap<std::string::String, std::string::String>,

    /// Output only. State of the EngineConfig (creating, active, deleting, etc.)
    pub state: crate::model::engine_config::State,

    /// Required. The resource name of the EngineVersion used in this model tuning.
    /// format:
    /// `/projects/{project_num}/locations/{location}/instances/{instance}/engineVersions/{engine_version}`
    pub engine_version: std::string::String,

    /// Optional. Configuration for tuning in creation of the EngineConfig.
    /// This field is required if `hyperparameter_source.type` is not `INHERITED`,
    /// and output-only otherwise.
    pub tuning: std::option::Option<crate::model::engine_config::Tuning>,

    /// Optional. PerformanceTarget gives information on how the tuning and
    /// training will be evaluated. This field is required if
    /// `hyperparameter_source.type` is not `INHERITED`, and output-only otherwise.
    pub performance_target: std::option::Option<crate::model::engine_config::PerformanceTarget>,

    /// Output only. The line of business (Retail/Commercial) this engine config is
    /// used for. Determined by EngineVersion, cannot be set by user.
    pub line_of_business: crate::model::LineOfBusiness,

    /// Optional. The origin of hyperparameters for the created EngineConfig. The
    /// default is `TUNING`. In this case, the hyperparameters are selected as a
    /// result of a
    /// tuning run.
    pub hyperparameter_source_type: crate::model::engine_config::HyperparameterSourceType,

    /// Optional. Configuration of hyperparameters source EngineConfig.
    pub hyperparameter_source:
        std::option::Option<crate::model::engine_config::HyperparameterSource>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl EngineConfig {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::EngineConfig::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::EngineConfig::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::EngineConfig::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::EngineConfig::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::EngineConfig::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [labels][crate::model::EngineConfig::labels].
    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [state][crate::model::EngineConfig::state].
    pub fn set_state<T: std::convert::Into<crate::model::engine_config::State>>(
        mut self,
        v: T,
    ) -> Self {
        self.state = v.into();
        self
    }

    /// Sets the value of [engine_version][crate::model::EngineConfig::engine_version].
    pub fn set_engine_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.engine_version = v.into();
        self
    }

    /// Sets the value of [tuning][crate::model::EngineConfig::tuning].
    pub fn set_tuning<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::engine_config::Tuning>,
    {
        self.tuning = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [tuning][crate::model::EngineConfig::tuning].
    pub fn set_or_clear_tuning<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::engine_config::Tuning>,
    {
        self.tuning = v.map(|x| x.into());
        self
    }

    /// Sets the value of [performance_target][crate::model::EngineConfig::performance_target].
    pub fn set_performance_target<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::engine_config::PerformanceTarget>,
    {
        self.performance_target = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [performance_target][crate::model::EngineConfig::performance_target].
    pub fn set_or_clear_performance_target<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::engine_config::PerformanceTarget>,
    {
        self.performance_target = v.map(|x| x.into());
        self
    }

    /// Sets the value of [line_of_business][crate::model::EngineConfig::line_of_business].
    pub fn set_line_of_business<T: std::convert::Into<crate::model::LineOfBusiness>>(
        mut self,
        v: T,
    ) -> Self {
        self.line_of_business = v.into();
        self
    }

    /// Sets the value of [hyperparameter_source_type][crate::model::EngineConfig::hyperparameter_source_type].
    pub fn set_hyperparameter_source_type<
        T: std::convert::Into<crate::model::engine_config::HyperparameterSourceType>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.hyperparameter_source_type = v.into();
        self
    }

    /// Sets the value of [hyperparameter_source][crate::model::EngineConfig::hyperparameter_source].
    pub fn set_hyperparameter_source<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::engine_config::HyperparameterSource>,
    {
        self.hyperparameter_source = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [hyperparameter_source][crate::model::EngineConfig::hyperparameter_source].
    pub fn set_or_clear_hyperparameter_source<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::engine_config::HyperparameterSource>,
    {
        self.hyperparameter_source = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for EngineConfig {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.financialservices.v1.EngineConfig"
    }
}

/// Defines additional types related to [EngineConfig].
pub mod engine_config {
    #[allow(unused_imports)]
    use super::*;

    /// The parameters needed for the tuning operation, these are used only in
    /// tuning and not passed on to training.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Tuning {
        /// Required. The resource name of the Primary Dataset used in this model
        /// tuning. For information about how primary and auxiliary datasets are
        /// used, refer to the engine version's documentation.  Format:
        /// `/projects/{project_num}/locations/{location}/instances/{instance}/datasets/{dataset}`
        pub primary_dataset: std::string::String,

        /// Required. End_time specifies the latest time from which labels are used
        /// and from which data is used to generate features for tuning.  End_time
        /// should be no later than the end of the date_range of the dataset.
        pub end_time: std::option::Option<wkt::Timestamp>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Tuning {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [primary_dataset][crate::model::engine_config::Tuning::primary_dataset].
        pub fn set_primary_dataset<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.primary_dataset = v.into();
            self
        }

        /// Sets the value of [end_time][crate::model::engine_config::Tuning::end_time].
        pub fn set_end_time<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::Timestamp>,
        {
            self.end_time = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [end_time][crate::model::engine_config::Tuning::end_time].
        pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::Timestamp>,
        {
            self.end_time = v.map(|x| x.into());
            self
        }
    }

    impl wkt::message::Message for Tuning {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.financialservices.v1.EngineConfig.Tuning"
        }
    }

    /// PerformanceTarget gives hints on how to evaluate the performance of a
    /// model.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct PerformanceTarget {
        /// Required. A number that gives the tuner a hint on the number of parties
        /// from this data that will be investigated per period (monthly). This is
        /// used to control how the model is evaluated. For example, when trying AML
        /// AI for the first time, we recommend setting this to the number of parties
        /// investigated in an average month, based on alerts from your existing
        /// automated alerting system.
        pub party_investigations_per_period_hint: i64,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl PerformanceTarget {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [party_investigations_per_period_hint][crate::model::engine_config::PerformanceTarget::party_investigations_per_period_hint].
        pub fn set_party_investigations_per_period_hint<T: std::convert::Into<i64>>(
            mut self,
            v: T,
        ) -> Self {
            self.party_investigations_per_period_hint = v.into();
            self
        }
    }

    impl wkt::message::Message for PerformanceTarget {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.financialservices.v1.EngineConfig.PerformanceTarget"
        }
    }

    /// Parameters for bootstrapping an Engine Config with the results of another
    /// one.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct HyperparameterSource {
        /// Required. The resource name of the source EngineConfig whose outputs are
        /// used. Format:
        /// `/projects/{project_num}/locations/{location}/instances/{instance}/engineConfigs/{engine_config}`
        pub source_engine_config: std::string::String,

        /// Output only. The resource name of the EngineVersion that was used in the
        /// tuning run. Format:
        /// `/projects/{project_num}/locations/{location}/instances/{instance}/engineVersions/{engine_version}`
        pub source_engine_version: std::string::String,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl HyperparameterSource {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [source_engine_config][crate::model::engine_config::HyperparameterSource::source_engine_config].
        pub fn set_source_engine_config<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.source_engine_config = v.into();
            self
        }

        /// Sets the value of [source_engine_version][crate::model::engine_config::HyperparameterSource::source_engine_version].
        pub fn set_source_engine_version<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.source_engine_version = v.into();
            self
        }
    }

    impl wkt::message::Message for HyperparameterSource {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.financialservices.v1.EngineConfig.HyperparameterSource"
        }
    }

    /// The possible states of a resource.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum State {
        /// State is unspecified, should not occur.
        Unspecified,
        /// The resource has not finished being created.
        Creating,
        /// The resource is active/ready to be used.
        Active,
        /// The resource is in the process of being updated.
        Updating,
        /// The resource is in the process of being deleted.
        Deleting,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [State::value] or
        /// [State::name].
        UnknownValue(state::UnknownValue),
    }

    #[doc(hidden)]
    pub mod state {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl State {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Creating => std::option::Option::Some(1),
                Self::Active => std::option::Option::Some(2),
                Self::Updating => std::option::Option::Some(3),
                Self::Deleting => std::option::Option::Some(4),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
                Self::Creating => std::option::Option::Some("CREATING"),
                Self::Active => std::option::Option::Some("ACTIVE"),
                Self::Updating => std::option::Option::Some("UPDATING"),
                Self::Deleting => std::option::Option::Some("DELETING"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for State {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for State {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for State {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Creating,
                2 => Self::Active,
                3 => Self::Updating,
                4 => Self::Deleting,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for State {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "STATE_UNSPECIFIED" => Self::Unspecified,
                "CREATING" => Self::Creating,
                "ACTIVE" => Self::Active,
                "UPDATING" => Self::Updating,
                "DELETING" => Self::Deleting,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for State {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Creating => serializer.serialize_i32(1),
                Self::Active => serializer.serialize_i32(2),
                Self::Updating => serializer.serialize_i32(3),
                Self::Deleting => serializer.serialize_i32(4),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for State {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
                ".google.cloud.financialservices.v1.EngineConfig.State",
            ))
        }
    }

    /// The type of the hyperparameter source.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum HyperparameterSourceType {
        /// Hyperparameter source type is unspecified, defaults to TUNING.
        Unspecified,
        /// The EngineConfig creation starts a tuning job which selects the best
        /// hyperparameters.
        Tuning,
        /// The hyperparameters are inherited from another EngineConfig.
        Inherited,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [HyperparameterSourceType::value] or
        /// [HyperparameterSourceType::name].
        UnknownValue(hyperparameter_source_type::UnknownValue),
    }

    #[doc(hidden)]
    pub mod hyperparameter_source_type {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl HyperparameterSourceType {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Tuning => std::option::Option::Some(1),
                Self::Inherited => std::option::Option::Some(2),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => {
                    std::option::Option::Some("HYPERPARAMETER_SOURCE_TYPE_UNSPECIFIED")
                }
                Self::Tuning => std::option::Option::Some("TUNING"),
                Self::Inherited => std::option::Option::Some("INHERITED"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for HyperparameterSourceType {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for HyperparameterSourceType {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for HyperparameterSourceType {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Tuning,
                2 => Self::Inherited,
                _ => Self::UnknownValue(hyperparameter_source_type::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for HyperparameterSourceType {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "HYPERPARAMETER_SOURCE_TYPE_UNSPECIFIED" => Self::Unspecified,
                "TUNING" => Self::Tuning,
                "INHERITED" => Self::Inherited,
                _ => Self::UnknownValue(hyperparameter_source_type::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for HyperparameterSourceType {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Tuning => serializer.serialize_i32(1),
                Self::Inherited => serializer.serialize_i32(2),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for HyperparameterSourceType {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(
                wkt::internal::EnumVisitor::<HyperparameterSourceType>::new(
                    ".google.cloud.financialservices.v1.EngineConfig.HyperparameterSourceType",
                ),
            )
        }
    }
}

/// Request for retrieving a paginated list of EngineConfig resources that
/// meet the specified criteria.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListEngineConfigsRequest {
    /// Required. The parent of the EngineConfig is the Instance.
    pub parent: std::string::String,

    /// The number of resources to be included in the response. The response
    /// contains a next_page_token, which can be used to retrieve the next page of
    /// resources.
    pub page_size: i32,

    /// In case of paginated results, this is the token that was returned in the
    /// previous ListEngineConfigsResponse. It should be copied here to retrieve
    /// the next page of resources. Empty will give the first page of
    /// ListEngineConfigsRequest, and the last page will return an empty
    /// page_token.
    pub page_token: std::string::String,

    /// Specify a filter to narrow search results.
    pub filter: std::string::String,

    /// Specify a field to use for ordering.
    pub order_by: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListEngineConfigsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListEngineConfigsRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListEngineConfigsRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListEngineConfigsRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListEngineConfigsRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [order_by][crate::model::ListEngineConfigsRequest::order_by].
    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.order_by = v.into();
        self
    }
}

impl wkt::message::Message for ListEngineConfigsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.financialservices.v1.ListEngineConfigsRequest"
    }
}

/// Response for retrieving a list of EngineConfigs
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListEngineConfigsResponse {
    /// List of EngineConfig resources
    pub engine_configs: std::vec::Vec<crate::model::EngineConfig>,

    /// This token should be passed to the next ListEngineConfigsRequest to
    /// retrieve the next page of EngineConfigs (empty indicates we are done).
    pub next_page_token: std::string::String,

    /// Locations that could not be reached.
    pub unreachable: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListEngineConfigsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [engine_configs][crate::model::ListEngineConfigsResponse::engine_configs].
    pub fn set_engine_configs<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::EngineConfig>,
    {
        use std::iter::Iterator;
        self.engine_configs = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListEngineConfigsResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }

    /// Sets the value of [unreachable][crate::model::ListEngineConfigsResponse::unreachable].
    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.unreachable = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ListEngineConfigsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.financialservices.v1.ListEngineConfigsResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListEngineConfigsResponse {
    type PageItem = crate::model::EngineConfig;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.engine_configs
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Request for retrieving a specific EngineConfig resource.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetEngineConfigRequest {
    /// Required. The resource name of the EngineConfig
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetEngineConfigRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetEngineConfigRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetEngineConfigRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.financialservices.v1.GetEngineConfigRequest"
    }
}

/// Request for creating an EngineConfig resource.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateEngineConfigRequest {
    /// Required. The parent of the EngineConfig is the Instance.
    pub parent: std::string::String,

    /// Required. The resource id of the EngineConfig
    pub engine_config_id: std::string::String,

    /// Required. The EngineConfig that will be created.
    pub engine_config: std::option::Option<crate::model::EngineConfig>,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and the
    /// request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateEngineConfigRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateEngineConfigRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [engine_config_id][crate::model::CreateEngineConfigRequest::engine_config_id].
    pub fn set_engine_config_id<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.engine_config_id = v.into();
        self
    }

    /// Sets the value of [engine_config][crate::model::CreateEngineConfigRequest::engine_config].
    pub fn set_engine_config<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::EngineConfig>,
    {
        self.engine_config = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [engine_config][crate::model::CreateEngineConfigRequest::engine_config].
    pub fn set_or_clear_engine_config<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::EngineConfig>,
    {
        self.engine_config = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::CreateEngineConfigRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for CreateEngineConfigRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.financialservices.v1.CreateEngineConfigRequest"
    }
}

/// Request for updating an EngineConfig
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateEngineConfigRequest {
    /// Optional. Field mask is used to specify the fields to be overwritten in the
    /// EngineConfig resource by the update.
    /// The fields specified in the update_mask are relative to the resource, not
    /// the full request. A field will be overwritten if it is in the mask. If the
    /// user does not provide a mask then all fields will be overwritten.
    pub update_mask: std::option::Option<wkt::FieldMask>,

    /// Required. The new value of the EngineConfig fields that will be updated
    /// according to the update_mask.
    pub engine_config: std::option::Option<crate::model::EngineConfig>,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and the
    /// request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdateEngineConfigRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [update_mask][crate::model::UpdateEngineConfigRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdateEngineConfigRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }

    /// Sets the value of [engine_config][crate::model::UpdateEngineConfigRequest::engine_config].
    pub fn set_engine_config<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::EngineConfig>,
    {
        self.engine_config = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [engine_config][crate::model::UpdateEngineConfigRequest::engine_config].
    pub fn set_or_clear_engine_config<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::EngineConfig>,
    {
        self.engine_config = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::UpdateEngineConfigRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for UpdateEngineConfigRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.financialservices.v1.UpdateEngineConfigRequest"
    }
}

/// Request for deleting an EngineConfig.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteEngineConfigRequest {
    /// Required. The resource name of the EngineConfig.
    pub name: std::string::String,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes after the first request.
    ///
    /// For example, consider a situation where you make an initial request and the
    /// request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteEngineConfigRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteEngineConfigRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::DeleteEngineConfigRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for DeleteEngineConfigRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.financialservices.v1.DeleteEngineConfigRequest"
    }
}

/// Request for exporting EngineConfig metadata.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExportEngineConfigMetadataRequest {
    /// Required. The resource name of the EngineConfig.
    pub engine_config: std::string::String,

    /// Required. BigQuery output where the metadata will be written.
    pub structured_metadata_destination: std::option::Option<crate::model::BigQueryDestination>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ExportEngineConfigMetadataRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [engine_config][crate::model::ExportEngineConfigMetadataRequest::engine_config].
    pub fn set_engine_config<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.engine_config = v.into();
        self
    }

    /// Sets the value of [structured_metadata_destination][crate::model::ExportEngineConfigMetadataRequest::structured_metadata_destination].
    pub fn set_structured_metadata_destination<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::BigQueryDestination>,
    {
        self.structured_metadata_destination = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [structured_metadata_destination][crate::model::ExportEngineConfigMetadataRequest::structured_metadata_destination].
    pub fn set_or_clear_structured_metadata_destination<T>(
        mut self,
        v: std::option::Option<T>,
    ) -> Self
    where
        T: std::convert::Into<crate::model::BigQueryDestination>,
    {
        self.structured_metadata_destination = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for ExportEngineConfigMetadataRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.financialservices.v1.ExportEngineConfigMetadataRequest"
    }
}

/// Response for exporting EngineConfig metadata.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExportEngineConfigMetadataResponse {
    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ExportEngineConfigMetadataResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }
}

impl wkt::message::Message for ExportEngineConfigMetadataResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.financialservices.v1.ExportEngineConfigMetadataResponse"
    }
}

/// EngineVersion controls which version of the engine is used to tune, train,
/// and run the model.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EngineVersion {
    /// Output only. Identifier. The resource name of the EngineVersion
    /// format:
    /// `/projects/{project_num}/locations/{location}/instances/{instance}/engineVersions/{engine_version}`
    pub name: std::string::String,

    /// Output only. The state of the version.
    pub state: crate::model::engine_version::State,

    /// Output only. Planned time to stop allowing training/tuning using this
    /// version. Existing trained models can still be used for prediction/backtest.
    pub expected_limitation_start_time: std::option::Option<wkt::Timestamp>,

    /// Output only. Planned time to stop supporting the version, in addition
    /// to no training or tuning, models trained on this version
    /// can no longer be used for prediction/backtest.
    pub expected_decommission_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The line of business (Retail/Commercial) this engine version
    /// is used for.
    pub line_of_business: crate::model::LineOfBusiness,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl EngineVersion {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::EngineVersion::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [state][crate::model::EngineVersion::state].
    pub fn set_state<T: std::convert::Into<crate::model::engine_version::State>>(
        mut self,
        v: T,
    ) -> Self {
        self.state = v.into();
        self
    }

    /// Sets the value of [expected_limitation_start_time][crate::model::EngineVersion::expected_limitation_start_time].
    pub fn set_expected_limitation_start_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.expected_limitation_start_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [expected_limitation_start_time][crate::model::EngineVersion::expected_limitation_start_time].
    pub fn set_or_clear_expected_limitation_start_time<T>(
        mut self,
        v: std::option::Option<T>,
    ) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.expected_limitation_start_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [expected_decommission_time][crate::model::EngineVersion::expected_decommission_time].
    pub fn set_expected_decommission_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.expected_decommission_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [expected_decommission_time][crate::model::EngineVersion::expected_decommission_time].
    pub fn set_or_clear_expected_decommission_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.expected_decommission_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [line_of_business][crate::model::EngineVersion::line_of_business].
    pub fn set_line_of_business<T: std::convert::Into<crate::model::LineOfBusiness>>(
        mut self,
        v: T,
    ) -> Self {
        self.line_of_business = v.into();
        self
    }
}

impl wkt::message::Message for EngineVersion {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.financialservices.v1.EngineVersion"
    }
}

/// Defines additional types related to [EngineVersion].
pub mod engine_version {
    #[allow(unused_imports)]
    use super::*;

    /// State determines the lifecycle of a version and the models/engine configs
    /// trained with it.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum State {
        /// Default state, should never be used.
        Unspecified,
        /// Version is available for training and inference.
        Active,
        /// Models using this version can still be run, but new ones cannot be
        /// trained.
        Limited,
        /// Version is deprecated, listed for informational purposes only.
        Decommissioned,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [State::value] or
        /// [State::name].
        UnknownValue(state::UnknownValue),
    }

    #[doc(hidden)]
    pub mod state {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl State {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Active => std::option::Option::Some(1),
                Self::Limited => std::option::Option::Some(2),
                Self::Decommissioned => std::option::Option::Some(3),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
                Self::Active => std::option::Option::Some("ACTIVE"),
                Self::Limited => std::option::Option::Some("LIMITED"),
                Self::Decommissioned => std::option::Option::Some("DECOMMISSIONED"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for State {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for State {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for State {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Active,
                2 => Self::Limited,
                3 => Self::Decommissioned,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for State {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "STATE_UNSPECIFIED" => Self::Unspecified,
                "ACTIVE" => Self::Active,
                "LIMITED" => Self::Limited,
                "DECOMMISSIONED" => Self::Decommissioned,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for State {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Active => serializer.serialize_i32(1),
                Self::Limited => serializer.serialize_i32(2),
                Self::Decommissioned => serializer.serialize_i32(3),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for State {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
                ".google.cloud.financialservices.v1.EngineVersion.State",
            ))
        }
    }
}

/// Request for retrieving a paginated list of EngineVersion resources that meet
/// the specified criteria.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListEngineVersionsRequest {
    /// Required. The parent of the EngineVersion is the Instance.
    pub parent: std::string::String,

    /// Optional. The number of resources to be included in the response. The
    /// response contains a next_page_token, which can be used to retrieve the next
    /// page of resources.
    pub page_size: i32,

    /// Optional. In case of paginated results, this is the token that was returned
    /// in the previous ListEngineVersionsResponse. It should be copied here to
    /// retrieve the next page of resources. Empty will give the first page of
    /// ListEngineVersionsRequest, and the last page will return an empty
    /// page_token.
    pub page_token: std::string::String,

    /// Optional. Specify a filter to narrow search results.
    /// If empty or unset will default to "state!=DEPRECATED",
    /// to view deprecated versions use "state:*" or any other filter.
    pub filter: std::string::String,

    /// Optional. Specify a field to use for ordering.
    pub order_by: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListEngineVersionsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListEngineVersionsRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListEngineVersionsRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListEngineVersionsRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListEngineVersionsRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [order_by][crate::model::ListEngineVersionsRequest::order_by].
    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.order_by = v.into();
        self
    }
}

impl wkt::message::Message for ListEngineVersionsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.financialservices.v1.ListEngineVersionsRequest"
    }
}

/// The response to a list call containing the list of engine versions.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListEngineVersionsResponse {
    /// List of EngineVersion resources
    pub engine_versions: std::vec::Vec<crate::model::EngineVersion>,

    /// This token should be passed to the next EngineVersionsRequest to retrieve
    /// the next page of EngineVersions (empty indicates we are done).
    pub next_page_token: std::string::String,

    /// Locations that could not be reached.
    pub unreachable: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListEngineVersionsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [engine_versions][crate::model::ListEngineVersionsResponse::engine_versions].
    pub fn set_engine_versions<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::EngineVersion>,
    {
        use std::iter::Iterator;
        self.engine_versions = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListEngineVersionsResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }

    /// Sets the value of [unreachable][crate::model::ListEngineVersionsResponse::unreachable].
    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.unreachable = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ListEngineVersionsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.financialservices.v1.ListEngineVersionsResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListEngineVersionsResponse {
    type PageItem = crate::model::EngineVersion;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.engine_versions
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Request for retrieving a specific EngineVersion resource.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetEngineVersionRequest {
    /// Required. The resource name of the EngineVersion
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetEngineVersionRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetEngineVersionRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetEngineVersionRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.financialservices.v1.GetEngineVersionRequest"
    }
}

/// Instance is a container for the rest of API resources.
/// Only resources in the same instance can interact with each other.
/// Child resources inherit the location (data residency) and encryption (CMEK).
/// The location of the provided input and output in requests must match the
/// location of the instance.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Instance {
    /// Output only. The full path to the Instance resource in this API.
    /// format: `projects/{project}/locations/{location}/instances/{instance}`
    pub name: std::string::String,

    /// Output only. Timestamp when the Instance was created.
    /// Assigned by the server.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. Timestamp when the Instance was last updated.
    /// Assigned by the server.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// Output only. State of the instance.
    /// Assigned by the server.
    pub state: crate::model::instance::State,

    /// Labels
    pub labels: std::collections::HashMap<std::string::String, std::string::String>,

    /// Required. The KMS key name used for CMEK (encryption-at-rest).
    /// format:
    /// `projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{cryptoKey}`
    /// VPC-SC restrictions apply.
    pub kms_key: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Instance {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::Instance::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::Instance::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::Instance::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::Instance::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::Instance::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [state][crate::model::Instance::state].
    pub fn set_state<T: std::convert::Into<crate::model::instance::State>>(mut self, v: T) -> Self {
        self.state = v.into();
        self
    }

    /// Sets the value of [labels][crate::model::Instance::labels].
    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [kms_key][crate::model::Instance::kms_key].
    pub fn set_kms_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.kms_key = v.into();
        self
    }
}

impl wkt::message::Message for Instance {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.financialservices.v1.Instance"
    }
}

/// Defines additional types related to [Instance].
pub mod instance {
    #[allow(unused_imports)]
    use super::*;

    /// The Resource State
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum State {
        /// State is unspecified, should not occur.
        Unspecified,
        /// The resource has not finished being created.
        Creating,
        /// The resource is active/ready to be used.
        Active,
        /// The resource is in the process of being updated.
        Updating,
        /// The resource is in the process of being deleted.
        Deleting,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [State::value] or
        /// [State::name].
        UnknownValue(state::UnknownValue),
    }

    #[doc(hidden)]
    pub mod state {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl State {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Creating => std::option::Option::Some(1),
                Self::Active => std::option::Option::Some(2),
                Self::Updating => std::option::Option::Some(3),
                Self::Deleting => std::option::Option::Some(4),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
                Self::Creating => std::option::Option::Some("CREATING"),
                Self::Active => std::option::Option::Some("ACTIVE"),
                Self::Updating => std::option::Option::Some("UPDATING"),
                Self::Deleting => std::option::Option::Some("DELETING"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for State {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for State {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for State {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Creating,
                2 => Self::Active,
                3 => Self::Updating,
                4 => Self::Deleting,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for State {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "STATE_UNSPECIFIED" => Self::Unspecified,
                "CREATING" => Self::Creating,
                "ACTIVE" => Self::Active,
                "UPDATING" => Self::Updating,
                "DELETING" => Self::Deleting,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for State {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Creating => serializer.serialize_i32(1),
                Self::Active => serializer.serialize_i32(2),
                Self::Updating => serializer.serialize_i32(3),
                Self::Deleting => serializer.serialize_i32(4),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for State {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
                ".google.cloud.financialservices.v1.Instance.State",
            ))
        }
    }
}

/// Request for retrieving a paginated list of Instance resources that meet the
/// specified criteria.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListInstancesRequest {
    /// Required. The parent of the Instance is the location for that Instance.
    /// Every location has exactly one instance.
    pub parent: std::string::String,

    /// The number of resources to be included in the response. The response
    /// contains a next_page_token, which can be used to retrieve the next page of
    /// resources.
    pub page_size: i32,

    /// In case of paginated results, this is the token that was returned in the
    /// previous ListInstancesResponse. It should be copied here to retrieve the
    /// next page of resources. This will be empty for the first instance of
    /// ListInstancesRequest.
    pub page_token: std::string::String,

    /// Specify a filter to narrow search results.
    pub filter: std::string::String,

    /// Specify a field to use for ordering.
    pub order_by: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListInstancesRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListInstancesRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListInstancesRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListInstancesRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListInstancesRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [order_by][crate::model::ListInstancesRequest::order_by].
    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.order_by = v.into();
        self
    }
}

impl wkt::message::Message for ListInstancesRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.financialservices.v1.ListInstancesRequest"
    }
}

/// Response for retrieving a list of Instances
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListInstancesResponse {
    /// List of Instance resources
    pub instances: std::vec::Vec<crate::model::Instance>,

    /// This token should be passed to the next ListInstancesRequest to retrieve
    /// the next page of Instances.
    pub next_page_token: std::string::String,

    /// Locations that could not be reached.
    pub unreachable: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListInstancesResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [instances][crate::model::ListInstancesResponse::instances].
    pub fn set_instances<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::Instance>,
    {
        use std::iter::Iterator;
        self.instances = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListInstancesResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }

    /// Sets the value of [unreachable][crate::model::ListInstancesResponse::unreachable].
    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.unreachable = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ListInstancesResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.financialservices.v1.ListInstancesResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListInstancesResponse {
    type PageItem = crate::model::Instance;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.instances
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Request for retrieving a specific Instance resource.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetInstanceRequest {
    /// Required. The resource name of the Instance.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetInstanceRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetInstanceRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetInstanceRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.financialservices.v1.GetInstanceRequest"
    }
}

/// Request for creating a Instance resource.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateInstanceRequest {
    /// Required. The parent of the Instance is the location for that Instance.
    /// Every location has exactly one instance.
    pub parent: std::string::String,

    /// Required. The resource id of the instance.
    pub instance_id: std::string::String,

    /// Required. The instance that will be created.
    pub instance: std::option::Option<crate::model::Instance>,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and the
    /// request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateInstanceRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateInstanceRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [instance_id][crate::model::CreateInstanceRequest::instance_id].
    pub fn set_instance_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.instance_id = v.into();
        self
    }

    /// Sets the value of [instance][crate::model::CreateInstanceRequest::instance].
    pub fn set_instance<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Instance>,
    {
        self.instance = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [instance][crate::model::CreateInstanceRequest::instance].
    pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Instance>,
    {
        self.instance = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::CreateInstanceRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for CreateInstanceRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.financialservices.v1.CreateInstanceRequest"
    }
}

/// Request for updating a Instance
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateInstanceRequest {
    /// Optional. Field mask is used to specify the fields to be overwritten in the
    /// Instance resource by the update.
    /// The fields specified in the update_mask are relative to the resource, not
    /// the full request. A field will be overwritten if it is in the mask. If the
    /// user does not provide a mask then all fields will be overwritten.
    pub update_mask: std::option::Option<wkt::FieldMask>,

    /// Required. The new value of the instance fields that will be updated
    /// according to the update_mask
    pub instance: std::option::Option<crate::model::Instance>,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and the
    /// request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdateInstanceRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [update_mask][crate::model::UpdateInstanceRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdateInstanceRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }

    /// Sets the value of [instance][crate::model::UpdateInstanceRequest::instance].
    pub fn set_instance<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Instance>,
    {
        self.instance = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [instance][crate::model::UpdateInstanceRequest::instance].
    pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Instance>,
    {
        self.instance = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::UpdateInstanceRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for UpdateInstanceRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.financialservices.v1.UpdateInstanceRequest"
    }
}

/// Request for deleting a Instance.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteInstanceRequest {
    /// Required. The resource name of the Instance.
    pub name: std::string::String,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes after the first request.
    ///
    /// For example, consider a situation where you make an initial request and the
    /// request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteInstanceRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteInstanceRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::DeleteInstanceRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for DeleteInstanceRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.financialservices.v1.DeleteInstanceRequest"
    }
}

/// Request for adding/removing registered parties from BigQuery tables
/// specified by the customer.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ImportRegisteredPartiesRequest {
    /// Required. The full path to the Instance resource in this API.
    /// format: `projects/{project}/locations/{location}/instances/{instance}`
    pub name: std::string::String,

    /// Optional. List of BigQuery tables. Union of tables will be taken if there
    /// is more than one table. VPC-SC restrictions apply. format:
    /// `bq://{project}.{bqDatasetID}.{bqTableID}` Use of `datasets` is preferred
    /// over the latter due to its simplicity and the reduced risk of errors
    /// `party_tables` and `datasets` must not be provided at the
    /// same time
    pub party_tables: std::vec::Vec<std::string::String>,

    /// Required. Mode of the request.
    pub mode: crate::model::import_registered_parties_request::UpdateMode,

    /// Optional. If the request will not register the parties, just determine what
    /// would happen.
    pub validate_only: bool,

    /// Required. LineOfBusiness for the specified registered parties.
    pub line_of_business: crate::model::LineOfBusiness,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ImportRegisteredPartiesRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::ImportRegisteredPartiesRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [party_tables][crate::model::ImportRegisteredPartiesRequest::party_tables].
    pub fn set_party_tables<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.party_tables = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [mode][crate::model::ImportRegisteredPartiesRequest::mode].
    pub fn set_mode<
        T: std::convert::Into<crate::model::import_registered_parties_request::UpdateMode>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.mode = v.into();
        self
    }

    /// Sets the value of [validate_only][crate::model::ImportRegisteredPartiesRequest::validate_only].
    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.validate_only = v.into();
        self
    }

    /// Sets the value of [line_of_business][crate::model::ImportRegisteredPartiesRequest::line_of_business].
    pub fn set_line_of_business<T: std::convert::Into<crate::model::LineOfBusiness>>(
        mut self,
        v: T,
    ) -> Self {
        self.line_of_business = v.into();
        self
    }
}

impl wkt::message::Message for ImportRegisteredPartiesRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.financialservices.v1.ImportRegisteredPartiesRequest"
    }
}

/// Defines additional types related to [ImportRegisteredPartiesRequest].
pub mod import_registered_parties_request {
    #[allow(unused_imports)]
    use super::*;

    /// UpdateMode controls the behavior for ImportRegisteredParties.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum UpdateMode {
        /// Default mode.
        Unspecified,
        /// Replace parties that are removable in Parties Table with new parties.
        Replace,
        /// Add new parties to Parties Table.
        Append,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [UpdateMode::value] or
        /// [UpdateMode::name].
        UnknownValue(update_mode::UnknownValue),
    }

    #[doc(hidden)]
    pub mod update_mode {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl UpdateMode {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Replace => std::option::Option::Some(1),
                Self::Append => std::option::Option::Some(2),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("UPDATE_MODE_UNSPECIFIED"),
                Self::Replace => std::option::Option::Some("REPLACE"),
                Self::Append => std::option::Option::Some("APPEND"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for UpdateMode {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for UpdateMode {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for UpdateMode {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Replace,
                2 => Self::Append,
                _ => Self::UnknownValue(update_mode::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for UpdateMode {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "UPDATE_MODE_UNSPECIFIED" => Self::Unspecified,
                "REPLACE" => Self::Replace,
                "APPEND" => Self::Append,
                _ => Self::UnknownValue(update_mode::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for UpdateMode {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Replace => serializer.serialize_i32(1),
                Self::Append => serializer.serialize_i32(2),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for UpdateMode {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<UpdateMode>::new(
                ".google.cloud.financialservices.v1.ImportRegisteredPartiesRequest.UpdateMode",
            ))
        }
    }
}

/// Response for adding/removing registered parties from BigQuery tables.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ImportRegisteredPartiesResponse {
    /// Number of parties added by this operation.
    pub parties_added: i64,

    /// Number of parties removed by this operation.
    pub parties_removed: i64,

    /// Total number of parties that are registered in this instance, after the
    /// update operation was completed.
    pub parties_total: i64,

    /// Number of parties that failed to be removed by this operation.
    pub parties_failed_to_remove: i64,

    pub parties_uptiered: i64,

    /// Total number of parties that are downtiered in this instance
    pub parties_downtiered: i64,

    /// Number of parties that failed to be downtiered
    pub parties_failed_to_downtier: i64,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ImportRegisteredPartiesResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parties_added][crate::model::ImportRegisteredPartiesResponse::parties_added].
    pub fn set_parties_added<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
        self.parties_added = v.into();
        self
    }

    /// Sets the value of [parties_removed][crate::model::ImportRegisteredPartiesResponse::parties_removed].
    pub fn set_parties_removed<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
        self.parties_removed = v.into();
        self
    }

    /// Sets the value of [parties_total][crate::model::ImportRegisteredPartiesResponse::parties_total].
    pub fn set_parties_total<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
        self.parties_total = v.into();
        self
    }

    /// Sets the value of [parties_failed_to_remove][crate::model::ImportRegisteredPartiesResponse::parties_failed_to_remove].
    pub fn set_parties_failed_to_remove<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
        self.parties_failed_to_remove = v.into();
        self
    }

    /// Sets the value of [parties_uptiered][crate::model::ImportRegisteredPartiesResponse::parties_uptiered].
    pub fn set_parties_uptiered<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
        self.parties_uptiered = v.into();
        self
    }

    /// Sets the value of [parties_downtiered][crate::model::ImportRegisteredPartiesResponse::parties_downtiered].
    pub fn set_parties_downtiered<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
        self.parties_downtiered = v.into();
        self
    }

    /// Sets the value of [parties_failed_to_downtier][crate::model::ImportRegisteredPartiesResponse::parties_failed_to_downtier].
    pub fn set_parties_failed_to_downtier<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
        self.parties_failed_to_downtier = v.into();
        self
    }
}

impl wkt::message::Message for ImportRegisteredPartiesResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.financialservices.v1.ImportRegisteredPartiesResponse"
    }
}

/// Request to export a list of currently registered parties.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExportRegisteredPartiesRequest {
    /// Required. The full path to the Instance resource in this API.
    /// format: `projects/{project}/locations/{location}/instances/{instance}`
    pub name: std::string::String,

    /// Required. The location to output the RegisteredParties.
    pub dataset: std::option::Option<crate::model::BigQueryDestination>,

    /// Required. LineOfBusiness to get RegisteredParties from.
    pub line_of_business: crate::model::LineOfBusiness,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ExportRegisteredPartiesRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::ExportRegisteredPartiesRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [dataset][crate::model::ExportRegisteredPartiesRequest::dataset].
    pub fn set_dataset<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::BigQueryDestination>,
    {
        self.dataset = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [dataset][crate::model::ExportRegisteredPartiesRequest::dataset].
    pub fn set_or_clear_dataset<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::BigQueryDestination>,
    {
        self.dataset = v.map(|x| x.into());
        self
    }

    /// Sets the value of [line_of_business][crate::model::ExportRegisteredPartiesRequest::line_of_business].
    pub fn set_line_of_business<T: std::convert::Into<crate::model::LineOfBusiness>>(
        mut self,
        v: T,
    ) -> Self {
        self.line_of_business = v.into();
        self
    }
}

impl wkt::message::Message for ExportRegisteredPartiesRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.financialservices.v1.ExportRegisteredPartiesRequest"
    }
}

/// Response to export registered parties request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExportRegisteredPartiesResponse {
    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ExportRegisteredPartiesResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }
}

impl wkt::message::Message for ExportRegisteredPartiesResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.financialservices.v1.ExportRegisteredPartiesResponse"
    }
}

/// Model represents a trained model.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Model {
    /// Output only. The resource name of the Model.
    /// format:
    /// `/projects/{project_num}/locations/{location}/instances/{instance}/models/{model}`
    pub name: std::string::String,

    /// Output only. The timestamp of creation of this resource.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The timestamp of the most recent update of this resource.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// Labels
    pub labels: std::collections::HashMap<std::string::String, std::string::String>,

    /// Output only. State of the model (creating, active, deleting, etc.)
    pub state: crate::model::model::State,

    /// Output only. The EngineVersion used in training this model.  This is output
    /// only, and is determined from the EngineConfig used.
    pub engine_version: std::string::String,

    /// Required. The resource name of the EngineConfig the model training will be
    /// based on. Format:
    /// `/projects/{project_num}/locations/{location}/instances/{instance}/engineConfigs/{engineConfig}`
    pub engine_config: std::string::String,

    /// Required. The resource name of the Primary Dataset used in this model
    /// training. For information about how primary and auxiliary datasets are
    /// used, refer to the engine version's documentation.  Format:
    /// `/projects/{project_num}/locations/{location}/instances/{instance}/datasets/{dataset}`
    pub primary_dataset: std::string::String,

    /// Required. End_time specifies the latest time from which labels are used and
    /// from which data is used to generate features for training.  End_time should
    /// be no later than the end of the date_range of the dataset.
    pub end_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The line of business (Retail/Commercial) this model is used
    /// for. Determined by EngineConfig, cannot be set by user.
    pub line_of_business: crate::model::LineOfBusiness,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Model {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::Model::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::Model::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::Model::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::Model::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::Model::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [labels][crate::model::Model::labels].
    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [state][crate::model::Model::state].
    pub fn set_state<T: std::convert::Into<crate::model::model::State>>(mut self, v: T) -> Self {
        self.state = v.into();
        self
    }

    /// Sets the value of [engine_version][crate::model::Model::engine_version].
    pub fn set_engine_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.engine_version = v.into();
        self
    }

    /// Sets the value of [engine_config][crate::model::Model::engine_config].
    pub fn set_engine_config<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.engine_config = v.into();
        self
    }

    /// Sets the value of [primary_dataset][crate::model::Model::primary_dataset].
    pub fn set_primary_dataset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.primary_dataset = v.into();
        self
    }

    /// Sets the value of [end_time][crate::model::Model::end_time].
    pub fn set_end_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.end_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [end_time][crate::model::Model::end_time].
    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.end_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [line_of_business][crate::model::Model::line_of_business].
    pub fn set_line_of_business<T: std::convert::Into<crate::model::LineOfBusiness>>(
        mut self,
        v: T,
    ) -> Self {
        self.line_of_business = v.into();
        self
    }
}

impl wkt::message::Message for Model {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.financialservices.v1.Model"
    }
}

/// Defines additional types related to [Model].
pub mod model {
    #[allow(unused_imports)]
    use super::*;

    /// The possible states of a resource.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum State {
        /// State is unspecified, should not occur.
        Unspecified,
        /// The resource has not finished being created.
        Creating,
        /// The resource is active/ready to be used.
        Active,
        /// The resource is in the process of being updated.
        Updating,
        /// The resource is in the process of being deleted.
        Deleting,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [State::value] or
        /// [State::name].
        UnknownValue(state::UnknownValue),
    }

    #[doc(hidden)]
    pub mod state {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl State {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Creating => std::option::Option::Some(1),
                Self::Active => std::option::Option::Some(2),
                Self::Updating => std::option::Option::Some(3),
                Self::Deleting => std::option::Option::Some(4),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
                Self::Creating => std::option::Option::Some("CREATING"),
                Self::Active => std::option::Option::Some("ACTIVE"),
                Self::Updating => std::option::Option::Some("UPDATING"),
                Self::Deleting => std::option::Option::Some("DELETING"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for State {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for State {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for State {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Creating,
                2 => Self::Active,
                3 => Self::Updating,
                4 => Self::Deleting,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for State {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "STATE_UNSPECIFIED" => Self::Unspecified,
                "CREATING" => Self::Creating,
                "ACTIVE" => Self::Active,
                "UPDATING" => Self::Updating,
                "DELETING" => Self::Deleting,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for State {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Creating => serializer.serialize_i32(1),
                Self::Active => serializer.serialize_i32(2),
                Self::Updating => serializer.serialize_i32(3),
                Self::Deleting => serializer.serialize_i32(4),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for State {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
                ".google.cloud.financialservices.v1.Model.State",
            ))
        }
    }
}

/// Request for retrieving a paginated list of Model resources that meet the
/// specified criteria.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListModelsRequest {
    /// Required. The parent of the Model is the Instance.
    pub parent: std::string::String,

    /// The number of resources to be included in the response. The response
    /// contains a next_page_token, which can be used to retrieve the next page of
    /// resources.
    pub page_size: i32,

    /// In case of paginated results, this is the token that was returned in the
    /// previous ListModelsResponse. It should be copied here to retrieve the next
    /// page of resources. Empty will give the first page of ListModelsRequest, and
    /// the last page will return an empty page_token.
    pub page_token: std::string::String,

    /// Specify a filter to narrow search results.
    pub filter: std::string::String,

    /// Specify a field to use for ordering.
    pub order_by: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListModelsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListModelsRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListModelsRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListModelsRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListModelsRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [order_by][crate::model::ListModelsRequest::order_by].
    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.order_by = v.into();
        self
    }
}

impl wkt::message::Message for ListModelsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.financialservices.v1.ListModelsRequest"
    }
}

/// Response for retrieving a list of Models
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListModelsResponse {
    /// List of Model resources
    pub models: std::vec::Vec<crate::model::Model>,

    /// This token should be passed to the next ListModelsRequest to
    /// retrieve the next page of Models (empty indicicates we are done).
    pub next_page_token: std::string::String,

    /// Locations that could not be reached.
    pub unreachable: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListModelsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [models][crate::model::ListModelsResponse::models].
    pub fn set_models<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::Model>,
    {
        use std::iter::Iterator;
        self.models = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListModelsResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }

    /// Sets the value of [unreachable][crate::model::ListModelsResponse::unreachable].
    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.unreachable = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ListModelsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.financialservices.v1.ListModelsResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListModelsResponse {
    type PageItem = crate::model::Model;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.models
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Request for retrieving a specific Model resource.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetModelRequest {
    /// Required. The resource name of the Model
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetModelRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetModelRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetModelRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.financialservices.v1.GetModelRequest"
    }
}

/// Request for creating a Model resource.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateModelRequest {
    /// Required. The parent of the Model is the Instance.
    pub parent: std::string::String,

    /// Required. The resource id of the Model
    pub model_id: std::string::String,

    /// Required. The Model that will be created.
    pub model: std::option::Option<crate::model::Model>,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and the
    /// request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateModelRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateModelRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [model_id][crate::model::CreateModelRequest::model_id].
    pub fn set_model_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.model_id = v.into();
        self
    }

    /// Sets the value of [model][crate::model::CreateModelRequest::model].
    pub fn set_model<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Model>,
    {
        self.model = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [model][crate::model::CreateModelRequest::model].
    pub fn set_or_clear_model<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Model>,
    {
        self.model = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::CreateModelRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for CreateModelRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.financialservices.v1.CreateModelRequest"
    }
}

/// Request for updating a Model
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateModelRequest {
    /// Optional. Field mask is used to specify the fields to be overwritten in the
    /// Model resource by the update.
    /// The fields specified in the update_mask are relative to the resource, not
    /// the full request. A field will be overwritten if it is in the mask. If the
    /// user does not provide a mask then all fields will be overwritten.
    pub update_mask: std::option::Option<wkt::FieldMask>,

    /// Required. The new value of the Model fields that will be updated according
    /// to the update_mask.
    pub model: std::option::Option<crate::model::Model>,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and the
    /// request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdateModelRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [update_mask][crate::model::UpdateModelRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdateModelRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }

    /// Sets the value of [model][crate::model::UpdateModelRequest::model].
    pub fn set_model<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Model>,
    {
        self.model = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [model][crate::model::UpdateModelRequest::model].
    pub fn set_or_clear_model<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Model>,
    {
        self.model = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::UpdateModelRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for UpdateModelRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.financialservices.v1.UpdateModelRequest"
    }
}

/// Request for deleting a Model.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteModelRequest {
    /// Required. The resource name of the Model.
    pub name: std::string::String,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes after the first request.
    ///
    /// For example, consider a situation where you make an initial request and the
    /// request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteModelRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteModelRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::DeleteModelRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for DeleteModelRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.financialservices.v1.DeleteModelRequest"
    }
}

/// Request for exporting Model metadata.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExportModelMetadataRequest {
    /// Required. The resource name of the Model.
    pub model: std::string::String,

    /// Required. BigQuery output where the metadata will be written.
    pub structured_metadata_destination: std::option::Option<crate::model::BigQueryDestination>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ExportModelMetadataRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [model][crate::model::ExportModelMetadataRequest::model].
    pub fn set_model<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.model = v.into();
        self
    }

    /// Sets the value of [structured_metadata_destination][crate::model::ExportModelMetadataRequest::structured_metadata_destination].
    pub fn set_structured_metadata_destination<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::BigQueryDestination>,
    {
        self.structured_metadata_destination = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [structured_metadata_destination][crate::model::ExportModelMetadataRequest::structured_metadata_destination].
    pub fn set_or_clear_structured_metadata_destination<T>(
        mut self,
        v: std::option::Option<T>,
    ) -> Self
    where
        T: std::convert::Into<crate::model::BigQueryDestination>,
    {
        self.structured_metadata_destination = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for ExportModelMetadataRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.financialservices.v1.ExportModelMetadataRequest"
    }
}

/// Response for exporting Model metadata.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExportModelMetadataResponse {
    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ExportModelMetadataResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }
}

impl wkt::message::Message for ExportModelMetadataResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.financialservices.v1.ExportModelMetadataResponse"
    }
}

/// PredictionResult is the result of using a model to create predictions.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PredictionResult {
    /// Output only. The resource name of the PredictionResult.
    /// format:
    /// `/projects/{project_num}/locations/{location}/instances/{instance}/predictionResults/{prediction_result}`
    pub name: std::string::String,

    /// Output only. The timestamp of creation of this resource.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The timestamp of the most recent update of this resource.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// Labels
    pub labels: std::collections::HashMap<std::string::String, std::string::String>,

    /// Output only. State of the PredictionResult (creating, active, deleting,
    /// etc.)
    pub state: crate::model::prediction_result::State,

    /// Required. The resource name of the Dataset to do predictions on
    /// Format:
    /// `/projects/{project_num}/locations/{location}/instances/{instance}/dataset/{dataset_id}`
    pub dataset: std::string::String,

    /// Required. The resource name of the Model to use to use to make predictions
    /// Format:
    /// `/projects/{project_num}/locations/{location}/instances/{instance}/models/{model}`
    pub model: std::string::String,

    /// Required. Specifies the latest time from which data is used to generate
    /// features for predictions.  This time should be no later than the end of the
    /// [date_range][google.cloud.financialservices.v1.Dataset.date_range] of the
    /// dataset.
    ///
    /// [google.cloud.financialservices.v1.Dataset.date_range]: crate::model::Dataset::date_range
    pub end_time: std::option::Option<wkt::Timestamp>,

    /// The number of consecutive months to produce predictions for, ending with
    /// the last full month prior to
    /// [end_time][google.cloud.financialservices.v1.PredictionResult.end_time]
    /// according to the dataset's timezone.
    ///
    /// [google.cloud.financialservices.v1.PredictionResult.end_time]: crate::model::PredictionResult::end_time
    pub prediction_periods: i32,

    /// Required. Where to write the output of the predictions.
    pub outputs: std::option::Option<crate::model::prediction_result::Outputs>,

    /// Output only. The line of business (Retail/Commercial) this prediction is
    /// for. Determined by Model, cannot be set by user.
    pub line_of_business: crate::model::LineOfBusiness,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl PredictionResult {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::PredictionResult::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::PredictionResult::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::PredictionResult::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::PredictionResult::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::PredictionResult::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [labels][crate::model::PredictionResult::labels].
    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [state][crate::model::PredictionResult::state].
    pub fn set_state<T: std::convert::Into<crate::model::prediction_result::State>>(
        mut self,
        v: T,
    ) -> Self {
        self.state = v.into();
        self
    }

    /// Sets the value of [dataset][crate::model::PredictionResult::dataset].
    pub fn set_dataset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.dataset = v.into();
        self
    }

    /// Sets the value of [model][crate::model::PredictionResult::model].
    pub fn set_model<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.model = v.into();
        self
    }

    /// Sets the value of [end_time][crate::model::PredictionResult::end_time].
    pub fn set_end_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.end_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [end_time][crate::model::PredictionResult::end_time].
    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.end_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [prediction_periods][crate::model::PredictionResult::prediction_periods].
    pub fn set_prediction_periods<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.prediction_periods = v.into();
        self
    }

    /// Sets the value of [outputs][crate::model::PredictionResult::outputs].
    pub fn set_outputs<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::prediction_result::Outputs>,
    {
        self.outputs = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [outputs][crate::model::PredictionResult::outputs].
    pub fn set_or_clear_outputs<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::prediction_result::Outputs>,
    {
        self.outputs = v.map(|x| x.into());
        self
    }

    /// Sets the value of [line_of_business][crate::model::PredictionResult::line_of_business].
    pub fn set_line_of_business<T: std::convert::Into<crate::model::LineOfBusiness>>(
        mut self,
        v: T,
    ) -> Self {
        self.line_of_business = v.into();
        self
    }
}

impl wkt::message::Message for PredictionResult {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.financialservices.v1.PredictionResult"
    }
}

/// Defines additional types related to [PredictionResult].
pub mod prediction_result {
    #[allow(unused_imports)]
    use super::*;

    /// Outputs is a list of places where the operation will write results.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Outputs {
        /// Required. The location to output the predictions.
        pub prediction_destination: std::option::Option<crate::model::BigQueryDestination>,

        /// The location to output explainability information.  If not specified
        /// no explainability data will be output.
        pub explainability_destination: std::option::Option<crate::model::BigQueryDestination>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Outputs {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [prediction_destination][crate::model::prediction_result::Outputs::prediction_destination].
        pub fn set_prediction_destination<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::BigQueryDestination>,
        {
            self.prediction_destination = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [prediction_destination][crate::model::prediction_result::Outputs::prediction_destination].
        pub fn set_or_clear_prediction_destination<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::BigQueryDestination>,
        {
            self.prediction_destination = v.map(|x| x.into());
            self
        }

        /// Sets the value of [explainability_destination][crate::model::prediction_result::Outputs::explainability_destination].
        pub fn set_explainability_destination<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::BigQueryDestination>,
        {
            self.explainability_destination = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [explainability_destination][crate::model::prediction_result::Outputs::explainability_destination].
        pub fn set_or_clear_explainability_destination<T>(
            mut self,
            v: std::option::Option<T>,
        ) -> Self
        where
            T: std::convert::Into<crate::model::BigQueryDestination>,
        {
            self.explainability_destination = v.map(|x| x.into());
            self
        }
    }

    impl wkt::message::Message for Outputs {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.financialservices.v1.PredictionResult.Outputs"
        }
    }

    /// The possible states of a resource.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum State {
        /// State is unspecified, should not occur.
        Unspecified,
        /// The resource has not finished being created.
        Creating,
        /// The resource is active/ready to be used.
        Active,
        /// The resource is in the process of being updated.
        Updating,
        /// The resource is in the process of being deleted.
        Deleting,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [State::value] or
        /// [State::name].
        UnknownValue(state::UnknownValue),
    }

    #[doc(hidden)]
    pub mod state {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl State {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Creating => std::option::Option::Some(1),
                Self::Active => std::option::Option::Some(2),
                Self::Updating => std::option::Option::Some(3),
                Self::Deleting => std::option::Option::Some(4),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
                Self::Creating => std::option::Option::Some("CREATING"),
                Self::Active => std::option::Option::Some("ACTIVE"),
                Self::Updating => std::option::Option::Some("UPDATING"),
                Self::Deleting => std::option::Option::Some("DELETING"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for State {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for State {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for State {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Creating,
                2 => Self::Active,
                3 => Self::Updating,
                4 => Self::Deleting,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for State {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "STATE_UNSPECIFIED" => Self::Unspecified,
                "CREATING" => Self::Creating,
                "ACTIVE" => Self::Active,
                "UPDATING" => Self::Updating,
                "DELETING" => Self::Deleting,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for State {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Creating => serializer.serialize_i32(1),
                Self::Active => serializer.serialize_i32(2),
                Self::Updating => serializer.serialize_i32(3),
                Self::Deleting => serializer.serialize_i32(4),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for State {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
                ".google.cloud.financialservices.v1.PredictionResult.State",
            ))
        }
    }
}

/// Request for retrieving a paginated list of PredictionResult resources that
/// meet the specified criteria.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListPredictionResultsRequest {
    /// Required. The parent of the PredictionResult is the Instance.
    pub parent: std::string::String,

    /// The number of resources to be included in the response. The response
    /// contains a next_page_token, which can be used to retrieve the next page of
    /// resources.
    pub page_size: i32,

    /// In case of paginated results, this is the token that was returned in the
    /// previous ListPredictionResultsResponse. It should be copied here to
    /// retrieve the next page of resources. Empty will give the first page of
    /// ListPredictionResultsRequest, and the last page will return an empty
    /// page_token.
    pub page_token: std::string::String,

    /// Specify a filter to narrow search results.
    pub filter: std::string::String,

    /// Specify a field to use for ordering.
    pub order_by: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListPredictionResultsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListPredictionResultsRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListPredictionResultsRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListPredictionResultsRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListPredictionResultsRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [order_by][crate::model::ListPredictionResultsRequest::order_by].
    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.order_by = v.into();
        self
    }
}

impl wkt::message::Message for ListPredictionResultsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.financialservices.v1.ListPredictionResultsRequest"
    }
}

/// Response for retrieving a list of PredictionResults
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListPredictionResultsResponse {
    /// List of PredictionResult resources
    pub prediction_results: std::vec::Vec<crate::model::PredictionResult>,

    /// This token should be passed to the next ListPredictionResultsRequest to
    /// retrieve the next page of PredictionResults (empty indicicates we are
    /// done).
    pub next_page_token: std::string::String,

    /// Locations that could not be reached.
    pub unreachable: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListPredictionResultsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [prediction_results][crate::model::ListPredictionResultsResponse::prediction_results].
    pub fn set_prediction_results<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::PredictionResult>,
    {
        use std::iter::Iterator;
        self.prediction_results = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListPredictionResultsResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }

    /// Sets the value of [unreachable][crate::model::ListPredictionResultsResponse::unreachable].
    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.unreachable = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ListPredictionResultsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.financialservices.v1.ListPredictionResultsResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListPredictionResultsResponse {
    type PageItem = crate::model::PredictionResult;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.prediction_results
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Request for retrieving a specific PredictionResult resource.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetPredictionResultRequest {
    /// Required. The resource name of the PredictionResult
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetPredictionResultRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetPredictionResultRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetPredictionResultRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.financialservices.v1.GetPredictionResultRequest"
    }
}

/// Request for creating a PredictionResult resource.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreatePredictionResultRequest {
    /// Required. The parent of the PredictionResult is the Instance.
    pub parent: std::string::String,

    /// Required. The resource id of the PredictionResult
    pub prediction_result_id: std::string::String,

    /// Required. The PredictionResult that will be created.
    pub prediction_result: std::option::Option<crate::model::PredictionResult>,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and the
    /// request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreatePredictionResultRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreatePredictionResultRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [prediction_result_id][crate::model::CreatePredictionResultRequest::prediction_result_id].
    pub fn set_prediction_result_id<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.prediction_result_id = v.into();
        self
    }

    /// Sets the value of [prediction_result][crate::model::CreatePredictionResultRequest::prediction_result].
    pub fn set_prediction_result<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::PredictionResult>,
    {
        self.prediction_result = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [prediction_result][crate::model::CreatePredictionResultRequest::prediction_result].
    pub fn set_or_clear_prediction_result<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::PredictionResult>,
    {
        self.prediction_result = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::CreatePredictionResultRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for CreatePredictionResultRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.financialservices.v1.CreatePredictionResultRequest"
    }
}

/// Request for updating a PredictionResult
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdatePredictionResultRequest {
    /// Optional. Field mask is used to specify the fields to be overwritten in the
    /// PredictionResult resource by the update.
    /// The fields specified in the update_mask are relative to the resource, not
    /// the full request. A field will be overwritten if it is in the mask. If the
    /// user does not provide a mask then all fields will be overwritten.
    pub update_mask: std::option::Option<wkt::FieldMask>,

    /// Required. The new value of the PredictionResult fields that will be updated
    /// according to the update_mask.
    pub prediction_result: std::option::Option<crate::model::PredictionResult>,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and the
    /// request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdatePredictionResultRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [update_mask][crate::model::UpdatePredictionResultRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdatePredictionResultRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }

    /// Sets the value of [prediction_result][crate::model::UpdatePredictionResultRequest::prediction_result].
    pub fn set_prediction_result<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::PredictionResult>,
    {
        self.prediction_result = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [prediction_result][crate::model::UpdatePredictionResultRequest::prediction_result].
    pub fn set_or_clear_prediction_result<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::PredictionResult>,
    {
        self.prediction_result = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::UpdatePredictionResultRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for UpdatePredictionResultRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.financialservices.v1.UpdatePredictionResultRequest"
    }
}

/// Request for deleting a PredictionResult.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeletePredictionResultRequest {
    /// Required. The resource name of the PredictionResult.
    pub name: std::string::String,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes after the first request.
    ///
    /// For example, consider a situation where you make an initial request and the
    /// request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeletePredictionResultRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeletePredictionResultRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::DeletePredictionResultRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for DeletePredictionResultRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.financialservices.v1.DeletePredictionResultRequest"
    }
}

/// Request for exporting PredictionResult metadata.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExportPredictionResultMetadataRequest {
    /// Required. The resource name of the PredictionResult.
    pub prediction_result: std::string::String,

    /// Required. BigQuery output where the metadata will be written.
    pub structured_metadata_destination: std::option::Option<crate::model::BigQueryDestination>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ExportPredictionResultMetadataRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [prediction_result][crate::model::ExportPredictionResultMetadataRequest::prediction_result].
    pub fn set_prediction_result<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.prediction_result = v.into();
        self
    }

    /// Sets the value of [structured_metadata_destination][crate::model::ExportPredictionResultMetadataRequest::structured_metadata_destination].
    pub fn set_structured_metadata_destination<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::BigQueryDestination>,
    {
        self.structured_metadata_destination = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [structured_metadata_destination][crate::model::ExportPredictionResultMetadataRequest::structured_metadata_destination].
    pub fn set_or_clear_structured_metadata_destination<T>(
        mut self,
        v: std::option::Option<T>,
    ) -> Self
    where
        T: std::convert::Into<crate::model::BigQueryDestination>,
    {
        self.structured_metadata_destination = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for ExportPredictionResultMetadataRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.financialservices.v1.ExportPredictionResultMetadataRequest"
    }
}

/// Response for exporting PredictionResult metadata.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExportPredictionResultMetadataResponse {
    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ExportPredictionResultMetadataResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }
}

impl wkt::message::Message for ExportPredictionResultMetadataResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.financialservices.v1.ExportPredictionResultMetadataResponse"
    }
}

/// Represents the metadata of the long-running operation.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct OperationMetadata {
    /// Output only. The time the operation was created.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The time the operation finished running.
    pub end_time: std::option::Option<wkt::Timestamp>,

    /// Output only. Server-defined resource path for the target of the operation.
    /// format: "/projects/{project}/..."
    /// VPC-SC restrictions apply.
    pub target: std::string::String,

    /// Output only. Name of the verb executed by the operation.
    pub verb: std::string::String,

    /// Output only. Human-readable status of the operation, if any.
    pub status_message: std::string::String,

    /// Output only. Identifies whether the user has requested cancellation of the
    /// operation.
    ///
    /// Successfully cancelled operations have a [Operation.error][] value
    /// with a [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding
    /// to `Code.CANCELLED`.
    ///
    /// [google.rpc.Status.code]: rpc::model::Status::code
    pub requested_cancellation: bool,

    /// Output only. API version used to start the operation.
    pub api_version: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl OperationMetadata {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
    pub fn set_end_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.end_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.end_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [target][crate::model::OperationMetadata::target].
    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.target = v.into();
        self
    }

    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.verb = v.into();
        self
    }

    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.status_message = v.into();
        self
    }

    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.requested_cancellation = v.into();
        self
    }

    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.api_version = v.into();
        self
    }
}

impl wkt::message::Message for OperationMetadata {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.financialservices.v1.OperationMetadata"
    }
}

/// Indicate which LineOfBusiness a party belongs to.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum LineOfBusiness {
    /// An unspecified LineOfBusiness. Do not use.
    Unspecified,
    /// Commercial LineOfBusiness.
    Commercial,
    /// Retail LineOfBusiness.
    Retail,
    /// If set, the enum was initialized with an unknown value.
    ///
    /// Applications can examine the value using [LineOfBusiness::value] or
    /// [LineOfBusiness::name].
    UnknownValue(line_of_business::UnknownValue),
}

#[doc(hidden)]
pub mod line_of_business {
    #[allow(unused_imports)]
    use super::*;
    #[derive(Clone, Debug, PartialEq)]
    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}

impl LineOfBusiness {
    /// Gets the enum value.
    ///
    /// Returns `None` if the enum contains an unknown value deserialized from
    /// the string representation of enums.
    pub fn value(&self) -> std::option::Option<i32> {
        match self {
            Self::Unspecified => std::option::Option::Some(0),
            Self::Commercial => std::option::Option::Some(1),
            Self::Retail => std::option::Option::Some(2),
            Self::UnknownValue(u) => u.0.value(),
        }
    }

    /// Gets the enum value as a string.
    ///
    /// Returns `None` if the enum contains an unknown value deserialized from
    /// the integer representation of enums.
    pub fn name(&self) -> std::option::Option<&str> {
        match self {
            Self::Unspecified => std::option::Option::Some("LINE_OF_BUSINESS_UNSPECIFIED"),
            Self::Commercial => std::option::Option::Some("COMMERCIAL"),
            Self::Retail => std::option::Option::Some("RETAIL"),
            Self::UnknownValue(u) => u.0.name(),
        }
    }
}

impl std::default::Default for LineOfBusiness {
    fn default() -> Self {
        use std::convert::From;
        Self::from(0)
    }
}

impl std::fmt::Display for LineOfBusiness {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
        wkt::internal::display_enum(f, self.name(), self.value())
    }
}

impl std::convert::From<i32> for LineOfBusiness {
    fn from(value: i32) -> Self {
        match value {
            0 => Self::Unspecified,
            1 => Self::Commercial,
            2 => Self::Retail,
            _ => Self::UnknownValue(line_of_business::UnknownValue(
                wkt::internal::UnknownEnumValue::Integer(value),
            )),
        }
    }
}

impl std::convert::From<&str> for LineOfBusiness {
    fn from(value: &str) -> Self {
        use std::string::ToString;
        match value {
            "LINE_OF_BUSINESS_UNSPECIFIED" => Self::Unspecified,
            "COMMERCIAL" => Self::Commercial,
            "RETAIL" => Self::Retail,
            _ => Self::UnknownValue(line_of_business::UnknownValue(
                wkt::internal::UnknownEnumValue::String(value.to_string()),
            )),
        }
    }
}

impl serde::ser::Serialize for LineOfBusiness {
    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    where
        S: serde::Serializer,
    {
        match self {
            Self::Unspecified => serializer.serialize_i32(0),
            Self::Commercial => serializer.serialize_i32(1),
            Self::Retail => serializer.serialize_i32(2),
            Self::UnknownValue(u) => u.0.serialize(serializer),
        }
    }
}

impl<'de> serde::de::Deserialize<'de> for LineOfBusiness {
    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
    where
        D: serde::Deserializer<'de>,
    {
        deserializer.deserialize_any(wkt::internal::EnumVisitor::<LineOfBusiness>::new(
            ".google.cloud.financialservices.v1.LineOfBusiness",
        ))
    }
}
